home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Tele / S / SmartClone.3.cpt / SmartClone 0.3.rsrc / STR#_1000.txt < prev    next >
Encoding:
Text File  |  1988-08-22  |  7.5 KB  |  475 lines

  1. SERVICE:               COMMAND KEY: ?
  2.  
  3. STATUS = "Smartcom II"
  4.  
  5. connected% = FALSE%
  6.  
  7. printerOn% = FALSE%
  8.  
  9. capturingFile% = FALSE%
  10.  
  11. sendingFile% = FALSE%
  12.  
  13. sendingTextFile% = FALSE%
  14.  
  15. SET DBOX 409
  16.  
  17. DBOX 409
  18.  
  19. LOOP:
  20.  
  21. theDBR% = DBOXRESULT%
  22.  
  23. IF theDBR% <> -2 THEN CURSOR WATCH:GOSUB theDBR%:hold off:cursor reset : SET DBOX 409
  24.  
  25. GOTO LOOP
  26.  
  27.  
  28.  
  29. 1:
  30.  
  31. IF (@modemFile = "") OR (NOT Exists%(ServiceFPath & @modemFile)) THEN ‚àÇ
  32.  
  33.     GOSUB getModemFile
  34.  
  35.     
  36.  
  37. IF connected% THEN ‚àÇ
  38.  
  39.     DO FILE @modemFile "HangUp" : ‚àÇ
  40.  
  41.     IF Message = "" THEN ‚àÇ
  42.  
  43.         connected% = FALSE% : ‚àÇ
  44.  
  45.         RETURN ‚àÇ
  46.  
  47.     ELSE ‚àÇ
  48.  
  49.         RETURN
  50.  
  51.  
  52.  
  53. MiniTermPhoneNumber = @MiniTermPhoneNumber
  54.  
  55. SET DBOX 400
  56.  
  57. DBoxResp(1) = MiniTermPhoneNumber
  58.  
  59. CheckBox%(1) = @redial%
  60.  
  61. DBOX 400
  62.  
  63. dialLoop:
  64.  
  65.     dbr% = DBoxResult%
  66.  
  67.     IF dbr% = -2 THEN ‚àÇ
  68.  
  69.         GOTO dialLoop
  70.  
  71. HOLD ON
  72.  
  73. CURSOR WATCH
  74.  
  75. redial% = CheckBox%(1)
  76.  
  77. dbr = DBoxResp(1)
  78.  
  79. IF dbr% = Cancel% THEN ‚àÇ
  80.  
  81.     RETURN
  82.  
  83. CLEAR DBOX 400
  84.  
  85. @redial% = redial%
  86.  
  87. IF dbr = "" THEN CLEAR @MiniTermPhoneNumber:RETURN
  88.  
  89. IF MiniTermPhoneNumber <> dbr THEN ‚àÇ
  90.  
  91.     @MiniTermPhoneNumber = dbr
  92.  
  93. IF dbr% = OK% THEN RETURN
  94.  
  95. Message = dbr
  96.  
  97. SaveMessage = Message
  98.  
  99. HOLD OFF
  100.  
  101. redial:
  102.  
  103.     DO FILE @modemFile "Dial"
  104.  
  105.     IF ResultCode% <> 0 THEN ‚àÇ
  106.  
  107.         badFile = @modemFile: ‚àÇ
  108.  
  109.         badLabel = "Dial": ‚àÇ
  110.  
  111.         GOSUB doFileError: ‚àÇ
  112.  
  113.         RETURN
  114.  
  115.     IF Message <> "" THEN ‚àÇ
  116.  
  117.         IF @redial% THEN ‚àÇ
  118.  
  119.             Message = SaveMessage: ‚àÇ
  120.  
  121.             GOTO redial ‚àÇ
  122.  
  123.         ELSE DISPLAY "Unable to connect:  " & Message
  124.  
  125.     IF Message = "" THEN ‚àÇ
  126.  
  127.         connected% = TRUE%
  128.  
  129.     RETURN
  130.  
  131.  
  132.  
  133. getModemFile: 'gets name of modem file and stores it in variable @modemFile
  134.  
  135.     HOLD ON
  136.  
  137.     Message = ""
  138.  
  139.     prompt1 = "Please select the modem file:"
  140.  
  141.     fileType1 = "SERV"
  142.  
  143.     HOLD OFF
  144.  
  145.     modemFile = GetFile(prompt1,fileType1,ServiceFPath)
  146.  
  147.     IF (ResultCode% = 100) OR (DBoxResult% = CANCEL%) THEN END
  148.  
  149.     HOLD ON
  150.  
  151.     CURSOR WATCH
  152.  
  153.  
  154.  
  155.     'parse the path from string returned by GetFile
  156.  
  157.     myPath = modemFile
  158.  
  159.     lastColon% = 0
  160.  
  161. getLastColon:
  162.  
  163.     IF InStr%(lastColon%+1, myPath, ":") <> 0 THEN ‚àÇ
  164.  
  165.         lastColon% = lastColon%+1: GOTO getLastColon
  166.  
  167.  
  168.  
  169.     myPath = Left(myPath,lastColon%)
  170.  
  171.     modemFile = Mid(modemFile, lastColon%+1)
  172.  
  173.  
  174.  
  175.     ServiceFPath = myPath   ' set ServiceFPath to path returned by GetFile
  176.  
  177.     Message = ""
  178.  
  179.     HOLD OFF
  180.  
  181.     DO FILE modemFile "Identify"
  182.  
  183.     IF (ResultCode% <> 0) THEN ‚àÇ
  184.  
  185.         IF (ResultCode% <> 106) THEN ‚àÇ          ' bad label error
  186.  
  187.             badFile = modemFile: ‚àÇ              ' 106 is "label not found" error
  188.  
  189.             badLabel = "Identify": ‚àÇ
  190.  
  191.             GOSUB doFileError: ‚àÇ
  192.  
  193.             CURSOR RESET: ‚àÇ
  194.  
  195.             END ‚àÇ
  196.  
  197.         ELSE Message = "NotModem"               ' coerce dbox for error #106
  198.  
  199.  
  200.  
  201.     ' check for if modemFile is really a modem file
  202.  
  203.     IF UpCase(Message) <> "MODEM" THEN ‚àÇ
  204.  
  205.         DBoxSay = modemFile & " does not appear to be a modem file.  " & ‚àÇ
  206.  
  207.             "An example of a modem file for Apple and " & ‚àÇ
  208.  
  209.             "Hayes-compatible modems is ""Hayes Modem.""  Try again?": ‚àÇ
  210.  
  211.         DBOX 2: ‚àÇ
  212.  
  213.         IF DBoxResult% = OK% THEN GOTO getModemFile ‚àÇ
  214.  
  215.         ELSE CURSOR RESET: END
  216.  
  217.     HOLD ON
  218.  
  219.  
  220.  
  221.     ' check to see if modem file in Lookup Table is still there
  222.  
  223.     IF @ModemFile <> "" THEN ‚àÇ
  224.  
  225.         IF NOT Exists%(ServiceFPath & @modemFile) THEN CLEAR @modemFile ‚àÇ
  226.  
  227.         ELSE DO FILE @modemFile "ClearTable": ‚àÇ
  228.  
  229.             IF ResultCode% <> 0 THEN ‚àÇ  ' check for errors executing "DO FILE"
  230.  
  231.                 badFile = @modemFile: ‚àÇ
  232.  
  233.                 badLabel =  "ClearTable": ‚àÇ
  234.  
  235.                 GOSUB doFileError: ‚àÇ
  236.  
  237.                 END
  238.  
  239.  
  240.  
  241.     @modemFile = modemFile  ' put new modem file in lookup table
  242.  
  243.     HOLD OFF
  244.  
  245.     CURSOR RESET
  246.  
  247.     Message = ""            ' routine was successful
  248.  
  249.     RETURN
  250.  
  251.  
  252.  
  253. doFIleError:    ' puts up error dialog and aborts
  254.  
  255.  
  256.  
  257.     HOLD OFF
  258.  
  259.     BELL:BELL   ' alert user
  260.  
  261.     ' Give user a description of error
  262.  
  263.     IF ResultCode% = 100 THEN END ‚àÇ
  264.  
  265.     ELSE IF ResultCode% = 106 THEN DBoxSay = "Cannot find the label """ & badLabel & ‚àÇ
  266.  
  267.         """ in the file """ & badFile & """.  Program aborted." ‚àÇ
  268.  
  269.     ELSE IF ResultCode% = -108 THEN ‚àÇ
  270.  
  271.         DBoxSay = "Not enough memory to open the file """ & ‚àÇ
  272.  
  273.         badFile & """.  Program aborted." ‚àÇ
  274.  
  275.     ELSE IF ResultCode% = -35 THEN ‚àÇ
  276.  
  277.         DBoxSay = "Cannot open the file """ & badFile & ‚àÇ
  278.  
  279.         """ because volume specified doesn't exist.  Program aborted." ‚àÇ
  280.  
  281.     ELSE IF ResultCode% = -49 THEN ‚àÇ
  282.  
  283.         DBoxSay = "Cannot open the file """ & badFile & ‚àÇ
  284.  
  285.         """ because it is already open for writing.  Program aborted." ‚àÇ
  286.  
  287.     ELSE IF ResultCode% = -47 THEN ‚àÇ
  288.  
  289.         DBoxSay = "Cannot open the file """ & badFile & ‚àÇ
  290.  
  291.         """ because it is busy.  Program aborted." ‚àÇ
  292.  
  293.     ELSE DBoxSay = "The following error occurred during a call to """ & badLabel & ‚àÇ
  294.  
  295.         """ in the file """ & badFile & """:  Macintosh error result code = " & ‚àÇ
  296.  
  297.         ResultCode% & ".  Program aborted."
  298.  
  299.     DBOX 1
  300.  
  301.     RETURN
  302.  
  303.  
  304.  
  305. 2:
  306.  
  307.     IF printerOn% THEN ‚àÇ
  308.  
  309.         printerOn% = FALSE% : ‚àÇ
  310.  
  311.         PRINTER OFF ‚àÇ
  312.  
  313.     ELSE ‚àÇ
  314.  
  315.         printerOn% = TRUE% : ‚àÇ
  316.  
  317.         PRINTER ON
  318.  
  319.     RETURN
  320.  
  321.  
  322.  
  323. 3:
  324.  
  325.     IF capturingFile% THEN ‚àÇ
  326.  
  327.         HOLD ON : ‚àÇ
  328.  
  329.         RECEIVE FILE END : ‚àÇ
  330.  
  331.         capturingFile% = FALSE% : ‚àÇ
  332.  
  333.         HOLD OFF : ‚àÇ
  334.  
  335.         RETURN
  336.  
  337.     
  338.  
  339.     textFile = putFile("Capture data to file:","")
  340.  
  341.     IF DBoxResult% = CANCEL% THEN RETURN
  342.  
  343.     RECEIVE FILE TEXT textFile
  344.  
  345.     capturingFile% = TRUE%
  346.  
  347.     RETURN
  348.  
  349.  
  350.  
  351. 4:
  352.  
  353.     IF sendingTextFile% THEN ‚àÇ
  354.  
  355.         SEND FILE END : ‚àÇ
  356.  
  357.         sendingTextFile% = FALSE% : ‚àÇ
  358.  
  359.         RETURN
  360.  
  361.     
  362.  
  363.     textFile = getFile("AutoType file:","TEXT")
  364.  
  365.     IF DBoxResult% = CANCEL% THEN RETURN
  366.  
  367.     sendingTextFile% = TRUE%
  368.  
  369.     SEND FILE TEXT textFile
  370.  
  371.     RETURN
  372.  
  373.  
  374.  
  375. 5:
  376.  
  377.     IF CommC.Protocol% = 0 THEN ‚àÇ
  378.  
  379.         proto = "AutoSelect" ELSE ‚àÇ
  380.  
  381.         IF CommC.Protocol% = 1 THEN ‚àÇ
  382.  
  383.             proto = "MacBinary" ELSE ‚àÇ
  384.  
  385.             IF CommC.Protocol% = 2 THEN ‚àÇ
  386.  
  387.                 proto = "MacTerminal 1.1" ELSE ‚àÇ
  388.  
  389.                 IF CommC.Protocol% = 3 THEN ‚àÇ
  390.  
  391.                     proto = "Text Only" ELSE ‚àÇ
  392.  
  393.                     IF CommC.Protocol% = 4 THEN ‚àÇ
  394.  
  395.                         proto = "XMODEM Text" ELSE ‚àÇ
  396.  
  397.                         proto = "XMODEM"
  398.  
  399.                         
  400.  
  401.     thefile = getFile("Send file using " & proto & ".","")
  402.  
  403.     IF DBoxResult% = CANCEL% THEN RETURN
  404.  
  405.     SEND FILE thefile
  406.  
  407.     RETURN
  408.  
  409.                                                         
  410.  
  411. 6:
  412.  
  413.     IF CommC.Protocol% = 0 THEN ‚àÇ
  414.  
  415.         proto = "AutoSelect" ELSE ‚àÇ
  416.  
  417.         IF CommC.Protocol% = 1 THEN ‚àÇ
  418.  
  419.             proto = "MacBinary" ELSE ‚àÇ
  420.  
  421.             IF CommC.Protocol% = 2 THEN ‚àÇ
  422.  
  423.                 proto = "MacTerminal 1.1" ELSE ‚àÇ
  424.  
  425.                 IF CommC.Protocol% = 3 THEN ‚àÇ
  426.  
  427.                     proto = "Text Only" ELSE ‚àÇ
  428.  
  429.                     IF CommC.Protocol% = 4 THEN ‚àÇ
  430.  
  431.                         proto = "XMODEM Text" ELSE ‚àÇ
  432.  
  433.                         proto = "XMODEM"
  434.  
  435.                         
  436.  
  437.     thefile = putFile("Receive using " & proto & ":","Received File")
  438.  
  439.     IF DBoxResult% = CANCEL% THEN RETURN
  440.  
  441.     RECEIVE FILE thefile
  442.  
  443.     RETURN
  444.  
  445.     
  446.  
  447. 7:
  448.  
  449.     DBoxSay = "Come on!  You really don't think TAL can do this, do ya?"
  450.  
  451.     DBox 1
  452.  
  453.     RETURN
  454.  
  455.  
  456.  
  457. 8:
  458.  
  459.     DBoxSay = "Refer to the Smartcom II manual for help."
  460.  
  461.     DBox 1
  462.  
  463.     RETURN
  464.  
  465.                               
  466.  
  467. Interrupt:
  468.  
  469.     STATUS = "Other"
  470.  
  471.     LEAVE
  472.  
  473.                              
  474.  
  475.